import {View, Text, Button} from 'react-native';
import React, {useEffect} from 'react';
import {useNavigation} from '@react-navigation/native';

export default function Login() {
  const navigation = useNavigation();
  const isLogin = true;

  useEffect(() => {
    if (isLogin) {
      navigation.replace('Home');
    }
  }, [navigation, isLogin]);

  const login = () => {
    navigation.replace('Home');
    console.log(1231);
  };
  return (
    <View>
      <Text>Login</Text>
      <Button onPress={login} title="登录" />
    </View>
  );
}
